package com.peanut.controller;

import com.peanut.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @className: com.peanut.controller-> UserController
 * @description: 这个类是做做什么得吖，小朋友？
 * @author: chenhs
 * @createDate: 2021-08-12 23:07
 * @version: 1.0
 */
@Controller
@RequestMapping(value = "/rest")
public class UserController {
    @Autowired
    private UserDao  userDao;

    @GetMapping(value = "/user/{id}")
    public String users(@PathVariable(value = "id") String id) {
        return "success";
    }
    @GetMapping(value = "/users")
    public String user() {
        return "success";
    }

    @DeleteMapping(value = "/delete/{id}")
    public String delete(@PathVariable Integer id) {
        System.out.println("123 :"+id);
        return "success";
    }
}
